from selenium.webdriver.common.by import By

from base import Base

class Page(Base):
    # 1点击搜索
    def page_sou_1(self):
        #ANDROID_UIAUTOMATOR定位
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.RelativeLayout").instance(3)')
        ele = self.find_ele(loc)
        return ele
    # 2输入商品名称
    def page_mingc_2(self):
        # CLASS_NAME定位
        loc = (By.CLASS_NAME,'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele
    # 3点击搜索按键
    def page_sous_3(self):
        # XPATH定位
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.achievo.vipshop:id/tv_search"]')
        ele = self.find_ele(loc)
        return ele
    # 4商品点击图片
    def page_tup_4(self):
        # ANDROID_UIAUTOMATOR定位
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().className("android.widget.FrameLayout").instance(23)')
        ele =self.find_ele(loc)
        return ele
    # 5点击添加购物车
    def page_gwce_5(self):
        # ID定位
        loc = (By.ID,'com.achievo.vipshop:id/bottom_left_price')
        ele = self.find_ele(loc)
        return ele
    # 6点击购物车图标
    def page_gwctb_6(self):
        # ID定位
        loc = (By.ID,'com.achievo.vipshop:id/bag_img')
        ele = self.find_ele(loc)
        return ele
    # 断言一 只看有货
    def page_duanya_1(self):
        # ANDROID_UIAUTOMATOR定位
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.achievo.vipshop:id/filterConstraintLayout").instance(6)')
        ele = self.find_ele(loc)
        return ele







